import { property, eventProperty } from '@/utils/decorators';
export default class Scope {
  @property({ displayName: '数量', type: 'number' })
  count: number = 100;
  pageSize: number = 10;
  current: number = 1;
  loading: boolean = false;
  dataSource: any[] = [
    {
      id: 1,
      name: '章三',
      age: 18,
      sex: '男',
    },
  ];
  pagination;

  // 卧槽
  constructor() {
    console.log('hahaha');
    console.log(6666);
    this.pagination = {
      total: this.count,
      pageSize: this.pageSize,
      current: this.current,
    };
  }

  title: string = '标题0';

  @eventProperty({ displayName: '点击' })
  handleClick(e: Event) {
    console.log('scope this: ', this);
    this.count += 1;
    this.title = '你好' + this.count;
  }

  onPageChange({ current, pageSize, total }: any) {
    console.log('页面发生变动 --> ', current, pageSize, total);
  }

  sayHello() {
    console.log('你好呀');
  }
}
